﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PanelBlood : MonoBehaviour
{
    /// <summary>
    /// 滴一滴血红心
    /// </summary>
    public Transform blood1;

    /// <summary>
    /// 滴一滴血空心
    /// </summary>
    public Transform blood1Unblood1;

    /// <summary>
    /// 滴二滴血红心
    /// </summary>
    public Transform blood2;

    /// <summary>
    /// 滴二滴血空心
    /// </summary>
    public Transform blood1Unblood2;

    /// <summary>
    /// 滴三滴血红心
    /// </summary>
    public Transform blood3;

    /// <summary>
    /// 滴三滴血空心
    /// </summary>
    public Transform blood3Unblood3;
    
    /// <summary>
    /// 检测当前血量并显示
    /// </summary>
    private void Update()
    {
        int currentBlood = BattleLogic.getInstance().GetCurrentBlood();
        blood1.gameObject.SetActive(currentBlood >= 1);
        blood2.gameObject.SetActive(currentBlood >= 2);
        blood3.gameObject.SetActive(currentBlood >= 3);
        blood1Unblood1.gameObject.SetActive(currentBlood < 1);
        blood1Unblood2.gameObject.SetActive(currentBlood < 2);
        blood3Unblood3.gameObject.SetActive(currentBlood < 3);
    }
}